package net.contrend.material.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import net.contrend.material.form.MaterialStorehouseForm;

import org.springframework.jdbc.core.RowMapper;

/**
 * <p>Copyright @ 2009 www.contrend.net</p>
 * <p>All right reserved. </p>
 * <p>项目名称			： 进销存管理系统 </p>
 * <p>JDK使用版本号		： jdk6.0 </P>
 * <p>描述				： 原料库 Form 与数据表映射 </p>
 * @版本					： 1.0.0 
 * @author				： 谢庚才
 *
 * <p>修改历史 </p>
 * <p>修改时间            修改人员    修改内容 </p>
 * <p>Dec 11, 2009       谢庚才     新建 </p>
 */
public class MaterialStorehouseMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int index) throws SQLException {
		MaterialStorehouseForm materialStorehouse = new MaterialStorehouseForm();
		materialStorehouse.setMsId(rs.getString("msId"));
		materialStorehouse.setCode(rs.getString("code"));
		materialStorehouse.setName(rs.getString("code"));
		materialStorehouse.setLocation(rs.getString("location"));
		materialStorehouse.setTelephone(rs.getString("telephone"));
		materialStorehouse.setChargeMan(rs.getString("chargeMan"));
		materialStorehouse.setArea(rs.getDouble("area"));
		
		java.sql.Date createDate = rs.getDate("createDate");
		materialStorehouse.setCreateDate(null==createDate?null:new Date(createDate.getTime()));
		materialStorehouse.setStatus(rs.getString("status"));
		return materialStorehouse;
	}

}
